<?php 
include "includes/session.php";
include "includes/comunes.php";
$sql="select * from (select * from  boletocompra,personas,vehiculo where boletoVendedor=personaId and boletoVehiculo=idAuto) as T1
 ";
//armo el Where de la consutla
$where=" where boletoId=".$_GET['bol_id'];
$result= cons_sql_up($sql.$where);
$reg=mysql_fetch_array($result);



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de Gestion de Vehiculos</title>

<link href="estilos.css" rel="stylesheet" type="text/css" />

<!--libreria jquery central-->
<script src="jquery-ui/js/jquery-1.9.1.js"></script>
<!--fin libreria central-->

<!--Librerias para el combo-->
<script language="JavaScript" type="text/javascript" src="combos/jquery.chainedSelects.js"></script>
<!--fin libreria-->

<!--librerias ui-->
<link href="jquery-ui/css/ui-lightness/jquery-ui-1.10.2.custom.css" rel="stylesheet"/>
<script src="jquery-ui/js/jquery-ui-1.10.2.custom.js"></script>
<!--fin libreria-->
<!--estilo para el scroll-->
<style>
  .ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    /* prevent horizontal scrollbar */
    overflow-x: hidden;
  }
  /* IE 6 doesn't support max-height
   * we use height instead, but this forces the menu to always be this tall
   */
  * html .ui-autocomplete {
    height: 300px;
  }
  </style>
<!--
  fin estilo scroll-->


<script language="JavaScript" type="text/javascript">
$(function()
{

//    funcion para validacion de formularios

             $("#eliminarvehiculo").submit(function () {

                  if (confirm('Esta seguro que desea eliminar el boleto?')){ 
					   return true;
					}else
					   return false;
                    
               
        });

            

});
</script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
</head>

<body>

<div class="container">
<?php include "includes/head.php"?>
   <div class="content">
       <div class="tituloprincipal">
          <?php include 'includes/submenu.php';?>  
           <img src="img/eliminar.jpg" width="25" height="25" border="0"/> Anular Boleto de Compra <?php echo $_GET['bol_id']?>
           </div>
       <form id="eliminarvehiculo" name="eliminarvehiculo" method="POST" action="eliminarBoletoCompra.php">
       <div class="contenedorpedido">
	  <fieldset>
              <legend><b>Datos de de la Operacion</b></legend> 
	   <table  width="100%">
				<tr>
                      <td class="textotablamenuform">Fecha Operacion</td>
                      <td class="textotablamenuform">
                          <?php echo format_fec($reg['boletofecha'],"/")?>
                      </td>
					  </tr>
                 <tr>
                      <td class="textotablamenuform">Vendedor</td>
                      <td class="textotablamenuform">
                          <?php echo $reg['personaDniCuit']." ".$reg['personaNombre']?>
                      </td>
					  </tr>
					  <?php if($reg['boletoAccionista']):?>
					  <tr>
                      <td class="textotablamenuform">Accionista 1</td>
                      <td class="textotablamenuform">
					      <?php echo obtener_nombre_personas($reg['boletoAccionista'])?> - 
                          <?php echo $reg['boletoAccionistaPor']?>% - 
                          $ <?php echo $reg['boletoAccionistaMonto']?>
						  <input type="hidden" class="campo_form" id="Acc1" name="Acc1" value="<?php echo $reg['boletoAccionista']?>">
						  <input type="hidden" class="campo_form" id="Acc1Monto" name="Acc1Monto" value="<?php echo $reg['boletoAccionistaMonto']?>">
                      </td>
					  </tr>
					  <?php endif?>
					  <?php if($reg['boletoAccionista1']):?>
					  <tr>
                      <td class="textotablamenuform">Accionista 2</td>
                      <td class="textotablamenuform">
					      <?php echo obtener_nombre_personas($reg['boletoAccionista1'])?> - 
                          <?php echo $reg['boletoAccionista1Por']?>% - 
                          $ <?php echo $reg['boletoAccionista1Monto']?>
						  <input type="hidden" class="campo_form" id="Acc2" name="Acc2" value="<?php echo $reg['boletoAccionista1']?>">
						   <input type="hidden" class="campo_form" id="Acc2Monto" name="Acc2Monto" value="<?php echo $reg['boletoAccionista1Monto']?>">
                      </td>
					  </tr>
					  <?php endif?>
					  <?php if($reg['boletoAccionista2']):?>
					  <tr>
                      <td class="textotablamenuform">Accionista 3</td>
                      <td class="textotablamenuform">
					      <?php echo obtener_nombre_personas($reg['boletoAccionista2'])?> - 
                          <?php echo $reg['boletoAccionista2Por']?>% - 
                          $ <?php echo $reg['boletoAccionista2Monto']?>
						  <input type="hidden" class="campo_form" id="Acc3" name="Acc3" value="<?php echo $reg['boletoAccionista2']?>">
						  <input type="hidden" class="campo_form" id="Acc3Monto" name="Acc3Monto" value="<?php echo $reg['boletoAccionista2Monto']?>">
                      </td>
					  </tr>
					  <?php endif?>
					  <?php if($reg['boletoAccionista3']):?>
					  <tr>
                      <td class="textotablamenuform">Accionista 3</td>
                      <td class="textotablamenuform">
					      <?php echo obtener_nombre_personas($reg['boletoAccionista3'])?> - 
                          <?php echo $reg['boletoAccionista3Por']?>% - 
                          $ <?php echo $reg['boletoAccionista3Monto']?>
						  <input type="hidden" class="campo_form" id="Acc4" name="Acc4" value="<?php echo $reg['boletoAccionista3']?>">
						  <input type="hidden" class="campo_form" id="Acc4Monto" name="Acc4Monto" value="<?php echo $reg['boletoAccionista3Monto']?>">
                      </td>
					  </tr>
					  <?php endif?>
					  
					  </table>
			</fieldset>	
           
        <fieldset>
             <legend><b>Datos del Vehiculo</b></legend>
             <table>
                 <tr>
                     <td class="textotablamenuform">Categoria</td>
                     <td class="textotablamenuform">
					 <input type="hidden" class="campo_form" id="id" name="id" value="<?php echo $_GET['bol_id']?>">
					  <input type="hidden" class="campo_form" id="veh" name="veh" value="<?php echo $reg['boletoVehiculo']?>">
                         <select name="categoria" id="categoria" class="campo_form" required disabled>
                             <option selected value="0">Seleccionar...</option>
                             <?php
                             $cat=obtener_categorias();

                             while($regPed=mysql_fetch_array($cat)){
							  if($regPed['idCategoria']==$reg['idCategoria'])
                                 echo "<option value='".utf8_encode($regPed['idCategoria'])."' selected>".utf8_encode($regPed['descripcion'])."</option>";
								 else
								 echo "<option value='".utf8_encode($regPed['idCategoria'])."'>".utf8_encode($regPed['descripcion'])."</option>";
								 
                             }

                             ?>

                         </select>


                     </td>
                     <td class="textotablamenuform">Marca</td>
                     <td class="textotablamenuform">
                         <select name="marca" id="marca" class="campo_form" required disabled>
                              <?php
                             $ped=obtener_marcas();
        
                             while($regPed=mysql_fetch_array($ped)){
							 if($regPed['id_marca']==$reg['idMarca'])
                                       echo "<option value='".utf8_encode($regPed['id_marca'])."' selected>".utf8_encode($regPed['descripcion'])."</option>";
									   else
									    echo "<option value='".utf8_encode($regPed['id_marca'])."'>".utf8_encode($regPed['descripcion'])."</option>";
									   
                           

                             }

                             ?>

                         </select>


                     </td>
                     <td class="textotablamenuform">Modelo</td>
                     <td class="textotablamenuform">
                          <?php echo obtener_nombre_modelo($reg['idModelo'])?>
                     </td>
                </tr>
                 <tr>
                     <td class="textotablamenuform">Version</td>
                     <td class="textotablamenuform">
                        <?php echo obtener_nombre_version($reg['idVersion'])?>
                     </td>
                     <td class="textotablamenuform">Año</td>
                     <td class="textotablamenuform">
                    <select name="ano" id="ano" class="campo_form" required disabled>
                              <?php
                             $ped=obtener_anos();

                             while($regPed=mysql_fetch_array($ped)){
							 if($regPed['id_ano']==$reg['ano'])
                                       echo "<option value='".utf8_encode($regPed['id_ano'])."' selected>".utf8_encode($regPed['descripcion'])."</option>";
									   else
									   echo "<option value='".utf8_encode($regPed['id_ano'])."'>".utf8_encode($regPed['descripcion'])."</option>";
									   
                           

                             }

                             ?>
                           

                         </select>
                     </td>
                     <td class="textotablamenuform">Color</td>
                     <td class="textotablamenuform">
                         
                        <select name="color" id="color" class="campo_form" required disabled>
                              <?php
                             $ped=obtener_color();
								
                             while($regPed=mysql_fetch_array($ped)){
							 if($regPed['id_color']==$reg['color'])
                                       echo "<option value='".utf8_encode($regPed['id_color'])."' selected>".utf8_encode($regPed['descripcion'])."</option>";
									   else
									   echo "<option value='".utf8_encode($regPed['id_color'])."'>".utf8_encode($regPed['descripcion'])."</option>";
                           

                             }

                             ?>
                           

                         </select>
                     
                     
                     
                     </td>
                 </tr>
                 <tr>
                    <td class="textotablamenuform">Condicion</td>
                     <td class="textotablamenuform">
                         <select name="condicion" id="condicion" class="campo_form" required disabled>
						 <?php if($reg['condicion']==2):?>
                              <option value='2' selected>Usado</option>
						<?php else:?>
						<option value='2'>Usado</option>
						<?php endif?>	
						<?php if($reg['condicion']==1):?>						
								<option value='1' selected>0 km</option>
								<?php else:?>
								<option value='1'>0 km</option>
								<?php endif?>	
                         </select>
                         
                     </td>

                    <td class="textotablamenuform">Kilometros</td>
                    <td class="textotablamenuform">
                        <input type="text" class="campo_form" id="km" name="km" value="<?php echo $reg['kilomtros']?>" disabled>
                    </td>
                     <td class="textotablamenuform">Precio Toma</td>
                   <td class="textotablamenuform">
                        <input type="number" class="campo_form" placeholder="Ej. 123421,43" disabled value="<?php echo $reg['precioToma']?>" disabled id="preciotoma" name="preciotoma" required>
                    </td>
                 </tr>
                  <tr>
                    <td class="textotablamenuform">Precio Costo</td>
                     <td class="textotablamenuform">
                            <input type="number" class="campo_form" placeholder="Ej. 123421,43" disabled value="<?php echo $reg['precioCosto']?>" disabled id="preciocosto" name="preciocosto" required>
                 
                         
                     </td>

                    <td class="textotablamenuform"></td>
                    <td class="textotablamenuform">
                        <!-- <input type="number" class="campo_form" id="por" name="por" value="" placeholder="Ej. 10"> -->
                    </td>
                       <td class="textotablamenuform"></td>
                     <td class="textotablamenuform">
                            <!-- <input type="number" class="campo_form" placeholder="Ej. 123421,43" id="precioventa" name="precioventa" required> -->
                 
                     </td>
                 </tr>
                   <tr>
                    <td class="textotablamenuform">Nro Chasis</td>
                     <td class="textotablamenuform" >
                            <input type="text" class="campo_form"  id="chasis" name="chasis" disabled value="<?php echo $reg['nroChasis']?>" required>
                 
                         
                     </td>
                   <td class="textotablamenuform">Nro Motor</td>
                     <td class="textotablamenuform" >
                            <input type="text" class="campo_form"  id="motor" name="motor" disabled value="<?php echo $reg['nroMotor']?>" required>
                 
                         
                     </td>
                   
                   <td class="textotablamenuform">Nro Patente</td>
                     <td class="textotablamenuform" >
                            <input type="text" class="campo_form"  id="patente" name="patente" disabled value="<?php echo $reg['patente']?>" required>
                 
                         
                     </td>
                   
                 </tr>
                 
                 
                 <tr>
                    <td class="textotablamenuform">Caracteristicas</td>
                     <td class="textotablamenuform" colspan="5">
                            <input type="text" class="campo_form" disabled placeholder="Ej. Cierre Centralizado, alarma, etc" id="carac" value="<?php echo $reg['caracteristicas']?>" name="carac" >
                 
                         
                     </td>

                   
                 </tr>
				
                 
                 
             </table>
        </fieldset>
      
           
		   
		   
           <fieldset style="text-align: right;">  
            <table style="text-align: right;">
             <tr>
                    <td class="textotablamenuform" style="text-align: right;" colspan="5">
                         <input type="submit" name="enviar" value="Anular Boleto"   class="boton_form"/>
                         
                     </td>
                 </tr>
                   </table>      
           </fieldset>  
		   
        
           
           
           
       </div>
   </form>
       <div class="clear"></div>
   <br>
   </div>
  <?php include "includes/pie.php"?>
  
</div>
</body>
</html>
